﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPFPokeCounter
{
    /// <summary>
    /// Window1.xaml の相互作用ロジック
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
            txtCount.Text = "0";
        }

        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key.ToString() == "R")
                reset();
            else
                txtCount.Text = (int.Parse(txtCount.Text) + 1).ToString();
        }

        private void btnReset_Click(object sender, RoutedEventArgs e)
        {
            reset();
        }
        private void reset()
        {
            txtCount.Text = "0";
        }
    }
}
